package hell.satan.droidbdf.base;

import android.app.Application;

import hell.satan.droidbdf.utils.Constants;
import hell.satan.droidbdf.utils.CrashHandler;

/**
 * Application封装类，可以静态调用。如果需要自己实现Application，必须继承此类
 * Wrapper for Application, can be statically called. You MUST extend this class
 * if you want to provide your own implementation.
 *
 * @author Cerberus
 */
@SuppressWarnings("unused")
public class BaseApp extends Application {
    /**
     * 全局唯一Application实例
     * The only instance of Application
     */
    private static Application sInstance;

    /**
     * 获取Application对象
     * Get Application instance
     */
    public static Application getInstance() {
        return sInstance;
    }

    public BaseApp() {
        sInstance = this;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        CrashHandler.init(this, Constants.PATH_CRASH);
    }
}
